﻿<views:MvxWpfView
	x:Class="Sidvall.LogManager.UI.Wpf.Views.StartView"
	xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:vms="clr-namespace:Sidvall.LogManager.UI.ViewModels;assembly=Sidvall.LogManager.UI"
	xmlns:Controls="clr-namespace:Sidvall.LogManager.UI.Wpf.Controls" 
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf" 
	xmlns:local="clr-namespace:Sidvall.LogManager.UI.Wpf.Views"
	mc:Ignorable="d" 
	d:DesignHeight="300" d:DesignWidth="600">

	<views:MvxWpfView.Resources>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="NotBooleanToVisibilityConverter" Not="True"/>
	</views:MvxWpfView.Resources>

	<Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:StartViewModel}}">
		<Grid.Background>
			<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.InactiveBorderColorKey}}"/>
		</Grid.Background>

		<Grid VerticalAlignment="Center" HorizontalAlignment="Center" Width="400" Visibility="{Binding StartIsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="30" />
			</Grid.RowDefinitions>

			<TextBlock FontWeight="Bold" FontSize="20" Text="{Binding WorkCaption}" HorizontalAlignment="Left" />
			<ProgressBar Grid.Row="1" Value="{Binding ProgressValue}" HorizontalContentAlignment="Stretch" />
		</Grid>
		<Grid Visibility="{Binding NewsIsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto" />
				<RowDefinition/>
			</Grid.RowDefinitions>
			<Controls:HeaderControl HeaderCaption="News" />
			<Grid Grid.Row="1">
				<Grid.Background>
					<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
				</Grid.Background>
				<StackPanel Orientation="Horizontal">
					<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.LogManager.UI.Wpf;component/Images/OK.png" 
										ToolTip="Close News" ButtonCommand="{Binding CloseNewsCommand}" ButtonText="OK" />
					<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.LogManager.UI.Wpf;component/Images/Clear.png" 
										ToolTip="Close News" ButtonCommand="{Binding UnsubscribeToNewsCommand}" ButtonText="Dont Show Again" />
				</StackPanel>
			</Grid>
			<Grid Grid.Row="2">
				<RichTextBox >

				</RichTextBox>
				<WebBrowser Grid.Row="1" local:StartView.Html="{Binding NewsHtml}" />
			</Grid>
		</Grid>
	</Grid>
</views:MvxWpfView>
